/****************************************************************************/
/* File: scs-display.h                                                      */
/* Desc: Specification file for the video display type                      */
/* Created: 2014-11-11                                                      */
/* Revised: 2014-11-20                                                      */
/* Authors: Sterling P. de Mille                                            */
/****************************************************************************/

// include once
#ifndef _SCS_DISPLAY_H_
#define _SCS_DISPLAY_H_

// core data types
#include "../Core/scs-types.h"
// core error codes
#include "../Core/scs-error.h"
// video color type
#include "scs-color.h"

// SDL framework
#include <SDL/SDL.h>
// SDL image support
#include <SDL/SDL_image.h>

// assert support
#include <assert.h>

// video rectangle type
typedef SDL_Rect SCSrectangle;

// video display type
class SCSdisplay {
protected:

	SDL_Surface* m_pkFrameBuffer;
	SCScolor m_kClearColor;

	// display singleton
	static SCSdisplay* m_pkSingleton;

public:

	// constructors
	SCSdisplay ();
	// destructor
	~SCSdisplay ();

	SCSerror Create (const SCSbool iFullscreen = SCS_FALSE);
	SCSerror Create (const SCSint iSizeX, const SCSint iSizeY, const SCSbool iFullscreen = SCS_FALSE);

	SCSint SizeX () const;
	SCSint SizeY () const;

	SCSint BitDepth () const;
	SCSbool HardwareEnabled () const;

	SDL_Surface* FrameBuffer () const;

	void Update ();
	void Clear ();

	void SetClearColor (const SCSfloat fRed, const SCSfloat fGreen, const SCSfloat fBlue, const SCSfloat fAlpha = 1);
	void SetClearColor (const SCScolor& rkColor);
	SCScolor GetClearColor () const;

	static SCSdisplay* Singleton ();
};

#endif // _SCS_DISPLAY_H_
